package com.asia5b.a5bmall.same.dialog

import android.content.Context
import android.text.TextUtils
import android.view.Gravity
import com.asia5b.a5bmall.same.R
import com.asia5b.a5mall.middleware.base.BaseDialog
import kotlinx.android.synthetic.main.dialog_ordercancel.*

/**
 * Created by zhangyuncai on 2020/5/23.
 */
class OrderCancelDialog(context: Context) : BaseDialog(context) {
    override val layoutId: Int = R.layout.dialog_ordercancel
    override val widthPercent: Double = 0.8
    override val gravity: Int = Gravity.CENTER


    override fun initView() {
    }

    override fun initEvent() {
        tv_ordercancel_sure.setOnClickListener {
            //取消原因
            val reason = tv_ordercancel_content.text.toString().trim()
            if (TextUtils.isEmpty(reason)) {
                return@setOnClickListener
            }
            mSureClick?.invoke(reason)
            dismiss()
        }
        tv_ordercancel_cancel.setOnClickListener {
            mCancelClick?.invoke()
            dismiss()
        }
    }


}